<template>
  <div class="">
    <div class="add">
      序号：<input type="text" v-model="id" /> 车型：<input
        type="text"
        v-model="title"
      />
      价格：<input type="text" v-model="price" />
      <button @click="add">添加</button>
      <input type="text" v-model="keyword" /><button @click="search">
        搜索
      </button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: "",
      title: "",
      price: "",
      keyword: "",
    };
  },
  mounted() {},
  methods: {
    add() {
      this.$emit("add", this.id, this.title, this.price);
      this.id = "";
      this.title = "";
      this.price = "";
    },
    search() {
      this.$emit("search", this.keyword);
    },
  },
  components: {},
};
</script>

<style lang="scss">
.add {
  display: flex;
  padding: 30px 0;
  justify-content: center;
}
</style>
